<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-ep+dxp/oz2RKF89ALMPGc7Z89QFa32C8Uv1A3TcEK8sMzXVysblLA3+eJWTzPJzT" crossorigin="anonymous"></script>

</head>
<body>
    <div th:replace="fragments/header:: navbar"></div>
    <div class="container pt-5">
    <h3 class="text-center">用户信息汇总</h3>
    <div class="row"> </div>
    <br/>
    <div class="col-6">
        <div class="alert alert-danger" th:if="${Message}" th:utext="${Message}"></div>
    </div>
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>用户编号</th>
                <th>登录名称</th>
                <th>用户全名</th>
                <th>用户电话</th>
                <th>用户地址</th>
                <th>银行卡号</th>
                <th>管理操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="user:${users}">
                <td>[[${user.userId}]]</td>
                <td>[[${user.userName}]]</td>
                <td>[[${user.userFullname}]]</td>
                <td>[[${user.userPhone}]]</td>
                <td>[[${user.userAddress}]]</td>
                <td>[[${user.userBankcard}]]</td>
                <td class="text-start">
                    <div class="btn-group flex-btn-group-container">
                        <a th:href="@{'/users/edit/{userId}'(userId=${user.userId})}"
                           class="btn btn-info btn-sm">
                            <span class="bi bi-eye"></span>
                            <span class="d-none d-md-inline">编辑</span>
                        </a>
<!--                        已包含在showAllUsers文件中-->
                        <a th:href="@{'/users/delete/{userId}'(userId=
                                ${user.userId})}"
                           class="btn btn-danger btn-sm">
                            <span class="bi bi-x"></span>
                            <span class="d-none d-md-inline">删除</span>
                        </a>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="col-12 text-end">
        <a class="btn btn-primary" th:href="@{users/add}">新增用户</a>
        <a class="btn btn-primary" th:href="@{/}">返回首页</a>
    </div>
</div>

</body>
</html>